package org.example.game.history;

/**
 * @Description: TODO
 * @Author wyatt
 * @Data 2024/06/23 11:23
 */
public class Solution100377 {

    public static void main(String[] args) {
        Solution100377 solution100377 = new Solution100377();
        System.out.println(solution100377.maximumTotalCost(new int[]{1,-2,3,4}));
    }


    public long maximumTotalCost(int[] nums) {
        long max = nums[0];
        for (int i = 1; i < nums.length; i++) {
            max += Math.abs(nums[i]);
        }
        return max;
    }
}
